package interview01

// 检查s2 是否为s1 旋转而成

func isFilpedString1(s1, s2 string) bool {
	var firstIdx int
	for i := 0; i < len(s1); i++ {
		if s1[i] == s2[0] {
			firstIdx = i
			break
		}
	}
	firstHalf := []byte(s1[:firstIdx])
	secondHalf := []byte(s1[firstIdx:])
	newStr := append(firstHalf, secondHalf...)
	return string(newStr) == s2
}
